import os
import sudoku
import numpy
import time

def main():
    root=".\\top95\\"
    file_list=os.listdir(root)
    tm=0
    s=sudoku.sudoku()
    for f in file_list:

        if ".txt" in f[-4:]:
            #print f
            mat=s.load_sudoku(root+f)
            #print mat
            t=time.time()
            mat=s.solve_sudoku_m1( mat)
            t=time.time()-t
            ok,x,y=s.control_mat(mat)
            tm+=t
            print f,", timer ", t, ", ok ", ok
    print "meantime ", tm/len(file_list)
if __name__ == "__main__":
    main()